{if $list}
<!--record-table  end-->
<div class="record-list">
  {foreach $list as $k=>$v}
  <table>
    <tr>
      <th colspan="4">交易订单号：{order_helper::order_id_encode($v.id, 2)}</th>
    </tr>
    {$count_num = count($v.detail)}
    <tr>
      {$value = $v.detail[0]}
      <td class="record-no" class="clearfix">
        <a class="left"  href="javascript:void(0);"><div style="width:100px;height:100px;overflow:hidden;" class="js_imgCenter"><img src="{_image($value.goods_cover)}"/></div></a>
        <div class="recors-r">
          <h3>{$value.goods_title}</h3>
          <p>{$value.refund_price|number_format:2}元</p>
        </div>
      </td>
      <td rowspan="{$count_num}">
        <a href="javascript:void(0);">{substr($v.add_time,0, 10)}</a>
        <a href="javascript:void(0);">{substr($v.add_time,10)}</a>
      </td>
      <td rowspan="{$count_num}">
        {if $v.type == 1}
        {refund_config::$refund_status_list[$v.refund_status]}
        {elseif $v.type == 2}
        {barter_config::$barter_status_list[$v.refund_status]}
        {else}
        申请成功
        {*repair_config::$repair_status_list[$v.refund_status]*}
        {/if}
      </td>
      <td class="service-edit" rowspan="{$count_num}">
        <a href="{AnUrl("service/{$v.id}")}">查看详情</a>
        {if $v.refund_status == 1 && $v.type < 3}
        <br /><a href="javascript:void(0);" class="js_cancelService" data-id="{$v.id}">取消服务</a>
        {/if}
      </td>
    </tr>
    {if $count_num > 1}
    <tr>
      {foreach $v.detail as $key => $value}
      {if $key !=0}
      <td class="record-no" class="clearfix">
        <a class="left"  href="javascript:void(0);"><div style="width:100px;height:100px;overflow:hidden;" class="js_imgCenter"><img src="{_image($value.goods_cover)}"/></div></a>
        <div class="recors-r">
          <h3>{$value.goods_title}</h3>
          <p>{$value.refund_price|number_format:2}元</p>
        </div>
      </td>
      {/if}
      {/foreach}
    </tr>
    {/if}
  </table>
  {/foreach}
</div>
<!--record-list  end-->
{include_core file="lib/page_fav.html"}
<script>
  $(function(){
    $('.js_cancelService').on('click', function(){
      var id = $(this).data('id');
      var url = siteUrl+'/service/cancel_service';
      var curr = $(this).closest('table');

      $.post(url, { id:id }, function(json){
        if (json.info == 'ok') {
          location.href = location.href;
          //curr.remove();
        } else {
          showMsg(json.info, 'error');
        }
      }, 'json');
    });

    // imageCenters($('.js_imgCenter'), 100, 100);
  });
</script>
{else}
<div class="menu-all"><p>暂无服务单</p></div>
{/if}